package com.java.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.java.common.utils.PageUtils;
import com.java.common.utils.Query;
import com.java.mapper.OrderStatusDao;
import com.java.pojo.OrderStatus;
import com.java.service.OrderStatusService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("orderStatusService")
public class OrderStatusServiceImpl extends ServiceImpl<OrderStatusDao, OrderStatus> implements OrderStatusService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<OrderStatus> page = this.page(
                new Query<OrderStatus>().getPage(params),
                // 拼接查询条件
                new LambdaQueryWrapper<OrderStatus>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<OrderStatus> getAutoCloseOrders() {
        return this.baseMapper.getAutoCloseOrders();
    }

}